<#macro panel_init>
	<script language="javascript">
	function closeOtherPanels(arrPanels,self){
		for(var i = 0;i<arrPanels.length;i++){
			eval(arrPanels[i]).hide();
		}
		eval(self).show();
	}
	function doSomeThing(id){
		eval(id).changeTitle(eval(id).eventObj.innerHTML);
	}
	function createModalPanel(id,targetid,title,pclass,dragable,triggerObjid){
		var str = id + " = new Panel('" + id + "','" + title + "','" + pclass + "'," + dragable + ");";
		str += id + ".eventObj = $('" + triggerObjid + "');";
		str += "CommonFunctions.cutNodeInto('" + targetid + "'," + id + ".content" + ");";
		str += id + ".setMaskPanel(maskpanel);" ;
		str += id + ".closePanel();";
		//str += "CommonFunctions.StartFloat('interval_" + id + "'," + id + ".container,3);";
		eval(str);
	}

	function createConfirmPanel(id,targetid,title,pclass,dragable,triggerObjid){
		var str = id + " = new ConfirmPanel('" + id + "','" + title + "','" + pclass + "'," + dragable + ");";
		str += id + ".eventObj = $('" + triggerObjid + "');";
		str += id + ".setMaskPanel(maskpanel);" ;
		str += id + ".closePanel();";
		//str += "CommonFunctions.StartFloat('interval_" + id + "'," + id + ".container,3);";
		eval(str);
	}

	function createAlertPanel(id,targetid,title,pclass,dragable,triggerObjid){
		var str = id + " = new AlertPanel('" + id + "','" + title + "','" + pclass + "'," + dragable + ");";
		str += id + ".eventObj = $('" + triggerObjid + "');";
		str += id + ".setMaskPanel(maskpanel);" ;
		str += id + ".closePanel();";
		//str += "CommonFunctions.StartFloat('interval_" + id + "'," + id + ".container,3);";
		eval(str);
	}

	function createProgressPanel(id,targetid,title,pclass,dragable,triggerObjid){
		var str = id + " = new ProgressPanel('" + id + "','" + title + "','" + pclass + "'," + dragable + ");";
		str += id + ".eventObj = $('" + triggerObjid + "');";
		str += id + ".setMaskPanel(maskpanel);" ;
		str += id + ".closePanel();";
		//str += "CommonFunctions.StartFloat('interval_" + id + "'," + id + ".container,3);";
		eval(str);
	}
	function createMessagePanel(id,targetid,title,pclass,dragable,triggerObjid){
		var str = id + " = new MessagePanel('" + id + "','" + title + "','" + pclass + "'," + dragable + ");";
		str += id + ".eventObj = $('" + triggerObjid + "');";
		str += id + ".setMaskMessagePanel(maskpanel);" ;
		str += id + ".closePanel();";
		str += "CommonFunctions.StartFloat('interval_" + id + "'," + id + ".container,3);"; 
		eval(str);
	}
	</script>
</#macro>

<#macro confirm_panel returnObj message okHandler cancelHandler ok="确定" no="取消" cancel="">
<script language="javascript">
var ${returnObj}_primitive = window.onload;
window.onload = function(){
   if(typeof(${returnObj}_primitive) == 'function')
      try{ ${returnObj}_primitive(); } catch(E){}
   ${returnObj}_newOnloadEvent();
}
function ${returnObj}_newOnloadEvent(){
	maskpanel = new MaskPanel("mask","MaskPanel",65);
		createConfirmPanel("${returnObj}","Panel_Confirm","确认","Panel MidPanel",true,'0');
		${returnObj}.initConfirm2("${ok}","${no}","${cancel}");
		${returnObj}.setConfirmText("${message}");
		${returnObj}.setButtonHandler(${okHandler},${cancelHandler});
}
</script>
</#macro>

<#macro confirm_panel_4button returnObj message okHandler cancelHandler button4Handler ok="确定" no="取消" cancel="" button4="">
<script language="javascript">
var ${returnObj}_primitive = window.onload;
window.onload = function(){
   if(typeof(${returnObj}_primitive) == 'function')
      try{ ${returnObj}_primitive(); } catch(E){}
   ${returnObj}_newOnloadEvent();
}
function ${returnObj}_newOnloadEvent(){
	maskpanel = new MaskPanel("mask","MaskPanel",65);
		createConfirmPanel("${returnObj}","Panel_Confirm","确认","Panel MidPanel",true,'0');
		${returnObj}.initConfirm2("${ok}","${button4}","${no}","${cancel}");
		${returnObj}.setConfirmText("${message}");
		${returnObj}.setButtonHandler(${okHandler},${cancelHandler},${button4Handler});
}
</script>
</#macro>

<#macro alert_panel returnObj message>
<script language="javascript">
var ${returnObj}_primitive = window.onload;
window.onload = function(){
   if(typeof(${returnObj}_primitive) == 'function')
      try{ ${returnObj}_primitive(); } catch(E){}
   ${returnObj}_newOnloadEvent();
}
function ${returnObj}_newOnloadEvent(){
	maskpanel = new MaskPanel("mask","MaskPanel",65);
		createAlertPanel("${returnObj}","Panel_Alert","确认","Panel ShortPanel",true,'0');
		${returnObj}.initAlert("确定");
		${returnObj}.setConfirmText("${message?html}");
}
</script>
</#macro>

<#macro progress_panel returnObj message>
<script language="javascript">
var ${returnObj}_primitive = window.onload;
window.onload = function(){
   if(typeof(${returnObj}_primitive) == 'function')
      try{ ${returnObj}_primitive(); } catch(E){}
   ${returnObj}_newOnloadEvent();
}
function ${returnObj}_newOnloadEvent(){
	maskpanel = new MaskPanel("mask","MaskPanel",65);
	createProgressPanel("${returnObj}","Panel_Progress","","Panel ShortPanel",true,'0');
	${returnObj}.initProgress();
	${returnObj}.setProgressText("${message?html}");
}
</script>
</#macro>
